﻿using BaseFramework;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;

namespace LiteFramework.Model
{
    [Serializable]
    [ComVisible(true)]
    [Entity("SYS_Role")]
    public class Role : PersistentEntity<Role>
    {
        public Role()
        {
            this.Id = Guid.Empty.ToString("N");
            this.ParentId = null; // "99999999-9999-9999-9999-999999999999";
        }

        #region Properties

        /// <summary>
        /// 主键
        /// </summary>
        [PrimaryKey(UnsavedValue = "00000000-0000-0000-0000-000000000000", Generator = PrimaryKeyType.UuidString)]
        [DisplayName("主键")]
        public string Id { get; set; }
        /// <summary>
        /// 父级角色ID
        /// </summary>
        [Property]
        [DisplayName("父级角色ID")]
        public string ParentId { get; set; }
        /// <summary>
        /// 角色名称
        /// </summary>
        [Property]
        [DisplayName("角色名称")]
        public string Name { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        [Property]
        [DisplayName("创建时间")]
        public DateTime TimeCreated { get; set; }
        /// <summary>
        /// 系统内置项
        /// </summary>
        [Property]
        [DisplayName("系统内置项")]
        public bool IsSystem { get;private set; }
        /// <summary>
        /// 描述
        /// </summary>
        [Property]
        [DisplayName("描述")]
        public string Description { get; set; }
        #endregion
    }
}